<?php

class ZFPainel_Controller_Router_Route_Tela extends Zend_Controller_Router_Route
{
    
    public function __construct($route = '', $defaults = array(), $reqs = array(), Zend_Translate $translator = null, $locale = null)
    {
        parent::__construct('painel/tela/:tela/*', array(
            'module' => 'painel',
            'controller' => 'tela',
            'action' => 'pegar',
            'tela' => '',
                ));
    }

    public function match($path, $partial = false)
    {
        if (false === ($r = parent::match($path, $partial))) {
            return false;
        }
        
        $tela = strtolower($r['tela']);
        
        $r['strategyController'] = substr($tela, 0, 3);
        $r['strategyAction'] = substr($tela, 3);
        return $r;
    }

}
